EC7412 Part II: Data Science for Economists
April 9, 2025
Welcome to a half-course in Data Science for Economists!
Who am I?
Who are you?
Tell me your name, interests, coding background, what you hope to get out of this (half-)course.
Most Economics education focuses on step 1 and 4 (and maybe 5).
This course will be about step 2 and 3.
RData wrangling intro
Programming principles
Our working environment = VS Code
Let’s do some data science!
Concluding remarks
# A tibble: 12 × 4
country year type count
<chr> <dbl> <chr> <dbl>
1 Afghanistan 1999 cases 745
2 Afghanistan 1999 population 19987071
3 Afghanistan 2000 cases 2666
4 Afghanistan 2000 population 20595360
5 Brazil 1999 cases 37737
6 Brazil 1999 population 172006362
7 Brazil 2000 cases 80488
8 Brazil 2000 population 174504898
9 China 1999 cases 212258
10 China 1999 population 1272915272
11 China 2000 cases 213766
12 China 2000 population 1280428583
Tidying data makes it easier to work with. We will be doing this a lot.
Key: <country, year>
country year cases population
<char> <num> <num> <num>
1: Afghanistan 1999 745 19987071
2: Afghanistan 2000 2666 20595360
3: Brazil 1999 37737 172006362
4: Brazil 2000 80488 174504898
5: China 1999 212258 1272915272
6: China 2000 213766 1280428583
Data wrangling intro
Programming principles
Our working environment = VS Code
Let’s do some data science!
Concluding remarks
snakeCase variable names with underscore_based names, use the same indentationhigh_scool_gpa, not hsgpa, (or worse question12 😱)edu_level = primary, secondary, high school is better than 1,2,3female = TRUE,FALSE is better than Sex = 1,21Data wrangling intro
Programming principles
Our working environment = VS Code
Let’s do some data science!
Concluding remarks
Let’s switch over to VS code and I’ll show you some useful things:
Data wrangling intro
Programming principles
Our working environment = VS Code
Let’s do some data science!
Concluding remarks
Problem set 0 - Due before next lecture (if you haven’t done it already)
Data wrangling intro
Programming principles
Our working environment = VS Code
Let’s do some data science!
Concluding remarks